home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / cpp.vim < prev    next >
Encoding:
Text File  |  2001-05-15  |  1.7 KB  |  62 lines

  1. " Vim syntax file
  2. " Language:    C++
  3. " Maintainer:    Ken Shan <ccshan@post.harvard.edu>
  4. " Last change:    2001 May 14
  5.  
  6. " For version 5.x: Clear all syntax items
  7. " For version 6.x: Quit when a syntax file was already loaded
  8. if version < 600
  9.   syntax clear
  10. elseif exists("b:current_syntax")
  11.   finish
  12. endif
  13.  
  14. " Read the C syntax to start with
  15. if version < 600
  16.   so <sfile>:p:h/c.vim
  17. else
  18.   runtime! syntax/c.vim
  19.   unlet b:current_syntax
  20. endif
  21.  
  22. " C++ extentions
  23. syn keyword cppStatement    new delete this friend using
  24. syn keyword cppAccess        public protected private
  25. syn keyword cppType        inline virtual explicit export bool wchar_t
  26. syn keyword cppExceptions    throw try catch
  27. syn keyword cppOperator        operator typeid
  28. syn match cppCast        "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
  29. syn match cppCast        "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
  30. syn keyword cppStorageClass    mutable
  31. syn keyword cppStructure    class typename template namespace
  32. syn keyword cppNumber    NPOS
  33. syn keyword cppBoolean    true false
  34.  
  35. " The minimum and maximum operators in GNU C++
  36. syn match cppMinMax "[<>]?"
  37.  
  38. " Default highlighting
  39. if version >= 508 || !exists("did_cpp_syntax_inits")
  40.   if version < 508
  41.     let did_cpp_syntax_inits = 1
  42.     command -nargs=+ HiLink hi link <args>
  43.   else
  44.     command -nargs=+ HiLink hi def link <args>
  45.   endif
  46.   HiLink cppAccess        cppStatement
  47.   HiLink cppCast        cppStatement
  48.   HiLink cppExceptions        cppStatement
  49.   HiLink cppOperator        cppStatement
  50.   HiLink cppStatement        Statement
  51.   HiLink cppType        Type
  52.   HiLink cppStorageClass    StorageClass
  53.   HiLink cppStructure        Structure
  54.   HiLink cppNumber        Number
  55.   HiLink cppBoolean        Boolean
  56.   delcommand HiLink
  57. endif
  58.  
  59. let b:current_syntax = "cpp"
  60.  
  61. " vim: ts=8
  62.